package com.example.app;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.example.app.adapter.SACAdapter;
import com.example.app.database.DBUserInfo;

import java.util.ArrayList;
import java.util.List;

public class ShowAllCount extends AppCompatActivity {

    private TextView textView;
    private Button back;
    private List<User> data =new ArrayList<>();
    private DBUserInfo dbUserInfo;
    private ListView listView;
    private SACAdapter sacAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_all_count);
        dbUserInfo=new DBUserInfo(this);
        data=dbUserInfo.getAllData();
        initView();
    }

    private void initView() {
        textView=findViewById(R.id.mm_tv);
        textView.setText("所有账户");
        back=findViewById(R.id.mm_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        listView=findViewById(R.id.sac_lv);
        sacAdapter=new SACAdapter(data,this);
        listView.setAdapter(sacAdapter);
    }
}